home *** CD-ROM | disk | FTP | other *** search
/ Hobby PC 13 / Hobby PC 13.iso / assets / Asset Library / Multimedia / Java Applets / Coalesceing Text / fxitems.xml < prev    next >
Extensible Markup Language  |  2001-04-09  |  6KB  |  116 lines

  1. <?xml version="1.0" standalone="yes"?>
  2.  
  3. <Items>
  4.  
  5. <Item CLASS="coalesce" TYPE="TEXT" ID="coalesce">
  6.     <Icon SRC="../java.gif"/>
  7.     <FileName SRC="Coalesce.class"/>
  8.     <Title><![CDATA[<B><I>Coalesce Text Applet</I></B>]]></Title>
  9.     <Description><![CDATA[This applet takes a text string and scatters the characters throughout a rectangular area. When the mouse enters the area, the letters arrange themselves into the original text string.]]></Description>
  10.     <SCRIPT LANGUAGE="JSCRIPT"><![CDATA[
  11.     var src, dest, attr, defval;
  12.     src = "%Pathname%" + "%thisItem.SQ_getChildAttribute(Filename, 0, SRC)%";
  13.  
  14.     var valappletWidth = '%htmlItem.SQ_getAttribute("appWidth",0,"VALUE")%';
  15.     var valappletHeight = '%htmlItem.SQ_getAttribute("appHeight",0,"VALUE")%';
  16.     var valparamText = '%htmlItem.SQ_getAttribute("parText",0,"VALUE")%';
  17.     var valparamAppBGColor = '%htmlItem.SQ_getAttribute("parAppBGColor",0,"VALUE")%';
  18.     var valparamPointSize = '%htmlItem.SQ_getAttribute("parPointSize",0,"VALUE")%';
  19.     var valparamFont = '%htmlItem.SQ_getAttribute("parFont",0,"VALUE")%';
  20.     var valparamTextColor = '%htmlItem.SQ_getAttribute("parTextColor",0,"VALUE")%';
  21.     var valparamStyle = '%htmlItem.SQ_getAttribute("parStyle",0,"VALUE")%';
  22.     var valparamHorizCenter = '%htmlItem.SQ_getAttribute("parHorizCenter",0,"VALUE")%';
  23.     var valparamVertCenter = '%htmlItem.SQ_getAttribute("parVertCenter",0,"VALUE")%';
  24.     var valparamAppBGImage = '%htmlItem.SQ_getAttribute("parAppBGImage",0,"VALUE")%';
  25.     var valparamAppTile = '%htmlItem.SQ_getAttribute("parAppTile",0,"VALUE")%';
  26.     var valparamDelayBetweenChars = '%htmlItem.SQ_getAttribute("parDelayBetweenChars",0,"VALUE")%';
  27.     var valparamDelayBetweenRuns = '%htmlItem.SQ_getAttribute("parDelayBetweenRuns",0,"VALUE")%';
  28.     var valparamXOffset = '%htmlItem.SQ_getAttribute("parXOffset",0,"VALUE")%';
  29.     var valparamYOffset = '%htmlItem.SQ_getAttribute("parYOffset",0,"VALUE")%';
  30.     var valparamSteps = '%htmlItem.SQ_getAttribute("parSteps",0,"VALUE")%';
  31.  
  32.     function dropfxnow()
  33.         {
  34.         if (valparamText == "")
  35.             {
  36.                   ans = Application.MessageBox("Please enter a text string in the appropriate field.", 0, "Coalesce Text Applet");
  37.             }
  38.         else
  39.             {
  40.             var applethtml = '<APPLET CODE="Coalesce.class" CODEBASE="' + attr + '" HEIGHT="' + valappletHeight + '" WIDTH="' + valappletWidth +'" ID="' + ActiveDocument.UniqueAttributeValue("ID","coalesce") + '" ALT="' + valparamText + '"><PARAM NAME="Text" VALUE="' + valparamText + '">';
  41.             if (valparamAppBGColor != "") {applethtml += '<PARAM NAME="AppBGColor" VALUE="' + valparamAppBGColor + '">'};
  42.             if (valparamPointSize != "") {applethtml += '<PARAM NAME="PointSize" VALUE="' + valparamPointSize + '">'};
  43.             if (valparamFont != "") {applethtml += '<PARAM NAME="Font" VALUE="' + valparamFont + '">'};
  44.             if (valparamTextColor != "") {applethtml += '<PARAM NAME="TextColor" VALUE="' + valparamTextColor + '">'};
  45.             if (valparamStyle != "") {applethtml += '<PARAM NAME="Style" VALUE="' + valparamStyle + '">'};
  46.             if (valparamHorizCenter != "") {applethtml += '<PARAM NAME="HorizCenter" VALUE="' + valparamHorizCenter + '">'};
  47.             if (valparamVertCenter != "") {applethtml += '<PARAM NAME="VertCenter" VALUE="' + valparamVertCenter + '">'};
  48.             if (valparamAppBGImage != "") {applethtml += '<PARAM NAME="AppBGImage" VALUE="' + valparamAppBGImage + '">'};
  49.             if (valparamAppTile != "") {applethtml += '<PARAM NAME="AppTile" VALUE="' + valparamAppTile + '">'};
  50.             if (valparamDelayBetweenChars != "") {applethtml += '<PARAM NAME="DelayBetweenChars" VALUE="' + valparamDelayBetweenChars + '">'};
  51.             if (valparamDelayBetweenRuns != "") {applethtml += '<PARAM NAME="DelayBetweenRuns" VALUE="' + valparamDelayBetweenRuns + '">'};
  52.             if (valparamXOffset != "") {applethtml += '<PARAM NAME="XOffset" VALUE="' + valparamXOffset + '">'};
  53.             if (valparamYOffset != "") {applethtml += '<PARAM NAME="YOffset" VALUE="' + valparamYOffset + '">'};
  54.             if (valparamSteps != "") {applethtml += '<PARAM NAME="Steps" VALUE="' + valparamSteps + '">'};
  55.             applethtml += '</APPLET>'; 
  56.                   Application.FX.HTML(applethtml);
  57.                   Application.FX.CopyFile(src,dst + '%Filename%');
  58.             }
  59.         }
  60.  
  61.     //modify the section above; it is unique to each validating form field
  62.  
  63.     function buildpath()
  64.         {
  65.         if (ActiveDocument.InCurrentProject)
  66.             {
  67.             dst = Application.ProjectDirectory + "\\applets\\coalesce\\";
  68.                   attr = Application.PathToURL(dst, ActiveDocument.LocalPath);
  69.             }
  70.         else
  71.             {
  72.             dst = ActiveDocument.LocalPath + "\\applets\\coalesce\\";
  73.             attr = "applets/coalesce/";
  74.             }
  75.         }
  76.  
  77.     function prepdrop()
  78.         {
  79.         var isittext;
  80.         Application.FX.SelectDropPoint();
  81.         if (Selection.IsParentElement("BODY") == true)
  82.             {
  83.             Application.FX.SelectDropPoint();
  84.             dropfxnow();
  85.             }                    
  86.         else
  87.             {
  88.             ans = Application.MessageBox("Please drop the object inside the BODY element.", 0, "Coalesce Text Applet");
  89.             }
  90.         }
  91.  
  92.     if (ActiveDocument.LocalPath != "")     // First, check if the file is saved
  93.         {
  94.         buildpath(); //build the path to the external file based on whether or not document is part of open project
  95.         prepdrop();  //determine whether or not it is legal to drop the form element at this location, or make it so
  96.         }
  97.     else
  98.         {
  99.         ans = Application.NoticeBox("Document must first be saved.", "Save now", null,"Cancel");
  100.  
  101.         if (ans == 1)
  102.             {
  103.             ActiveDocument.SaveAs();
  104.             }
  105.         if (ActiveDocument.LocalPath != "") //check again if they did indeed save and name file
  106.             {
  107.             buildpath();
  108.             prepdrop();
  109.             }
  110.         }
  111.     
  112. //    ]]></SCRIPT>
  113. </Item>
  114.  
  115.  
  116. </Items>